<template>
  <div class="login">
    <div class="login-con">
      <Card icon="log-in" title="欢迎登录">
        <div class="form-con">
          <login-form @on-success-valid="handleSubmit"></login-form>
          <p class="login-tip">输入任意用户名和密码即可</p>
        </div>
      </Card>
    </div>
  </div>
</template>

<script>
import LoginForm from "@/components/login-form";
export default {
  components: {
    LoginForm,
  },
  methods: {
    handleSubmit({ userName, password }) {
      console.log("登陆", userName, password);
      this.$router.push("home");
    },
  },
};
</script>

<style>
.login {
  width: 100%;
  height: 100%;

  background-size: cover;
  background-position: center;
  position: relative;
}
.login-con {
  margin: 0 auto;
  height: 300px;
  width: 300px;
  margin-top: 10%;
}
.login-con-header {
  font-size: 16px;
  font-weight: 300;
  text-align: center;
  padding: 30px 0;
}
.login-con .form-con {
  padding: 10px 0 0;
}
.login-con .login-tip {
  font-size: 10px;
  text-align: center;
  color: #c3c3c3;
}
</style>